<?php
/**
 * Created by PhpStorm.
 * User: sosyuki
 * Date: 2018/6/1
 * Time: 15:00
 */

namespace Drupal\distribution\ViewsController\handler\field;


use Drupal\distribution\Entity\Distribution;
use views_handler_field;

class DistributionFieldOrderCount extends views_handler_field {

  public function render($values) {
    $value = $this->get_value($values);
    if (!empty($value)) {
      return Distribution::getOrderCount($value);
    }
    return 0;
  }

}
